#!/bin/bash
# Copyright 2012 Google Inc.  All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License.  You may obtain a copy
# of the License at: http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distrib-
# uted under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
# OR CONDITIONS OF ANY KIND, either express or implied.  See the License for
# specific language governing permissions and limitations under the License.

# Usage:
#
# tools/run [<options>]
#     Starts the App Engine dev server on the source directory (serving the
#     output of make) for local development and testing.  Serves on port 8000
#     by default, or the port specified in a file named DEFAULT_PORT located
#     in the same directory as app.yaml.  You can supply any additional
#     dev_appserver options, such as --port to override the default port.

pushd "$(dirname $0)" >/dev/null && source common.sh && popd >/dev/null

echo Serving from: $LOCAL_RUN_DIR
$PYTHON $APPENGINE_DIR/dev_appserver.py --port $DEFAULT_PORT --address '' "$@" $LOCAL_RUN_DIR
